package com.sinosoft.flow.service.impl;

import com.sinosoft.flow.dao.UserMapper;
import com.sinosoft.flow.domain.po.SystemUser;
import com.sinosoft.flow.service.CacheService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: njz
 * @Description:
 * @Date: create in 2022/1/10 17:11
 */
@Service
public class CacheServiceImpl implements CacheService {

    @Resource
    private UserMapper userMapper;

    @Override
    @Cacheable(cacheNames="users")
    public List<SystemUser> findCache() {
        System.out.println("查询数据库");
        return userMapper.selectUsers();
    }
}
